<template>
  <div>
    <div class="login-container">
      <el-row type="flex" justify="center">
        <el-form :label-position="labelPosition" label-width="80px" class="search">
          <el-form-item label="搜索">
            <el-input v-model="input" placeholder="请输入内容" clearable>
              <el-button slot="append" icon="el-icon-search" @click="search"></el-button>
            </el-input>
          </el-form-item>
        </el-form>
      </el-row>
    </div>
  </div>

</template>

<script>

import { getCateList } from '@/api/category'

export default {
  data() {
    return {
      labelPosition: 'top',
      input: '',
      cateList: [],
      // 未处理的数据
      not_dealData: []
    };
  },

  methods: {
   async search() {
      // input框输入的值
      console.log(42, this.input);
      // // 调接口拿数据
      // const res = await getCateList()
      // console.log(res,'ressss');
      // this.not_dealData = res.data
      // console.log('this.not_dealData',this.not_dealData);
      // this.not_dealData.forEach(item => {
      //   console.log('item', item.category);
      //   if (item.category) {
      //     if (this.formLabelAlign.input === item.category.id) {
      //       // console.log(123);
      //       this.cateList = item.cateList
      //       console.log('this.cateList', this.cateList);
      //     }
      //   } else {
      //     this.cateList = [{
      //       image: 'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fc-ssl.duitang.com%2Fuploads%2Fitem%2F202001%2F17%2F20200117231331_3GwTW.jpeg&refer=http%3A%2F%2Fc-ssl.duitang.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=auto?sec=1673687463&t=f0eb77860bf5ecdcf068d36785bb9f85',
      //       title: '未分类',
      //       desc: '属于未分类项',
      //       id: 999
      //     }]
      //   }
      // })
      if(this.input==='地产分类'){
        this.$router.push('/category')
      } else if(this.input==='房产经纪') {
        this.$router.push('/agent')
      }else if(this.input==='关于我们'){
        this.$router.push('/regards')

      }else {
        this.$router.push('/*')
      }
    }
  }
}

</script>

<style scoped lang="scss">
.search {
  width: 30%;
}

.el-form-item {
  margin-top: 65%;
}

.login-container {
  justify-content: center;
  align-items: stretch;
  background-image: url('@/assets/pic1.webp');
  background-size: 100% 100%;
  height: 100%;
  width: 100%;
  position: fixed;
}
</style>